package com.jdy.haoduoaiteacher.view;//package com.jdy.haoduoaiteacher.view;
//
//import java.text.ParseException;
//import java.text.SimpleDateFormat;
//import java.util.Calendar;
//import java.util.Date;
//import java.util.Locale;
//
//import com.jdy.haoduoaiteacher.util.Tools;
//
//public class CalendarRest {
//  public static SimpleDateFormat DAY_FORMAT = new SimpleDateFormat("yyyyMMdd",
//      Locale.CHINA);
//  public static SimpleDateFormat DAY_FORMAT_LINE = new SimpleDateFormat(
//      "yyyy-MM-dd", Locale.CHINA);
//  public static SimpleDateFormat MONTH_FORMAT_LINE = new SimpleDateFormat(
//      "yyyy-MM", Locale.CHINA);
//  public static SimpleDateFormat XINGQI = new SimpleDateFormat("EE",
//      Locale.CHINA);
//  public static String TODAY = "";
//  public static String TOMORROW = "";
//  public static String AFTERTOMORROW = "";
//  public static final String YUANDAN_01 = "20150101";
//  public static final String YUANDAN_02 = "20150102";
//  public static final String YUANDAN_03 = "20150103";
//  public static final String QINGRENJIE = "20150214";
//  public static final String CHUNJIE_01 = "20150218";
//  public static final String CHUNJIE_02 = "20150219";
//  public static final String CHUNJIE_03 = "20150220";
//  public static final String CHUNJIE_04 = "20150221";
//  public static final String CHUNJIE_05 = "20150222";
//  public static final String CHUNJIE_06 = "20150223";
//  public static final String CHUNJIE_07 = "20150224";
//  public static final String YUANXIAO = "20150305";
//  public static final String FUNVJIE = "20150308";
//  public static final String QINGMING_01 = "20150404";
//  public static final String QINGMING_02 = "20150405";
//  public static final String QINGMING_03 = "20150406";
//  public static final String LAODONG_01 = "20150501";
//  public static final String LAODONG_02 = "20150502";
//  public static final String LAODONG_03 = "20150503";
//  public static final String ERTONGJIE = "20150601";
//  public static final String DUANWU_01 = "20150620";
//  public static final String DUANWU_02 = "20150621";
//  public static final String DUANWU_03 = "20150622";
//  public static final String JIAOSHIJIE = "20150901";
//  public static final String ZHONGQIU_01 = "20150926";
//  public static final String ZHONGQIU_02 = "20150927";
//  public static final String GUOQING_01 = "20151001";
//  public static final String GUOQING_02 = "20151002";
//  public static final String GUOQING_03 = "20151003";
//  public static final String GUOQING_04 = "20151004";
//  public static final String GUOQING_05 = "20151005";
//  public static final String GUOQING_06 = "20151006";
//  public static final String GUOQING_07 = "20151007";
//  public static final String FUQINJIE = "20150621";
//  public static final String MUQINJIE = "20150510";
//  static {
//    long time = System.currentTimeMillis();
//    TODAY = DAY_FORMAT.format(new Date());
//    TOMORROW = DAY_FORMAT.format(new Date(time + 24 * 60 * 60 * 1000));
//    AFTERTOMORROW = DAY_FORMAT.format(new Date(time + 24 * 60 * 60 * 1000 * 2));
//  }
//
//  public static boolean isRestDay(String date) {
//    if (Tools.isEmpty(date)) {
//      return false;
//    }
//    Boolean isRestDay = false;
//    switch (date) {
//    case YUANDAN_01:
//    case YUANDAN_02:
//    case YUANDAN_03:
//    case CHUNJIE_01:
//    case CHUNJIE_02:
//    case CHUNJIE_03:
//    case CHUNJIE_04:
//    case CHUNJIE_05:
//    case CHUNJIE_06:
//    case CHUNJIE_07:
//    case YUANXIAO:
//    case QINGMING_01:
//    case QINGMING_02:
//    case QINGMING_03:
//    case LAODONG_01:
//    case LAODONG_02:
//    case LAODONG_03:
//    case DUANWU_01:
//    case DUANWU_02:
//    case DUANWU_03:
//    case ZHONGQIU_01:
//    case ZHONGQIU_02:
//    case GUOQING_01:
//    case GUOQING_02:
//    case GUOQING_03:
//    case GUOQING_04:
//    case GUOQING_05:
//    case GUOQING_06:
//    case GUOQING_07:
//      isRestDay = true;
//      break;
//    default:
//      break;
//    }
//    return isRestDay;
//  }
//
//  // string date 格式yyyy-MM-dd 或者 yyyyMMdd
//  public static String getDateName(String date) {
//
//    if (Tools.isEmpty(date)) {
//      return "";
//    }
//    String stringDate = date.replace("-", "");
//    String str = "";
//    switch (stringDate) {
//    case YUANDAN_01:
//      str = "元旦";
//      break;
//    case CHUNJIE_01:
//      str = "除夕";
//      break;
//    case GUOQING_01:
//      str = "国庆";
//      break;
//    case LAODONG_01:
//      str = "五一";
//      break;
//    case DUANWU_01:
//      str = "端午";
//      break;
//    case QINGMING_01:
//      str = "清明";
//      break;
//    case ZHONGQIU_01:
//      str = "中秋";
//      break;
//    case JIAOSHIJIE:
//      str = "教师节";
//      break;
//    case YUANXIAO:
//      str = "元宵节";
//      break;
//    case QINGRENJIE:
//      str = "情人节";
//      break;
//    case FUNVJIE:
//      str = "妇女节";
//      break;
//    case ERTONGJIE:
//      str = "儿童节";
//      break;
//    case FUQINJIE:
//      str = "父亲节";
//      break;
//    case MUQINJIE:
//      str = "母亲节";
//      break;
//    default:
//      if (stringDate.equals(TODAY)) {
//        str = "今天";
//      } else if (stringDate.equals(TOMORROW)) {
//        str = "明天";
//      } else if (stringDate.equals(AFTERTOMORROW)) {
//        str = "后天";
//      } else {
//        Date dateDay = null;
//        try {
//          dateDay = DAY_FORMAT.parse(stringDate);
//          str = XINGQI.format(dateDay);
//        } catch (Exception e) {
//          e.printStackTrace();
//          str = "";
//        }
//      }
//      break;
//    }
//    return str;
//  }
//
//  public static boolean isInFestivalRange(Date date, String festival,
//      int dayRange) {
//    int day = -1;
//    Calendar toCalendar = Calendar.getInstance();
//    toCalendar.setTime(date);
//    toCalendar.set(Calendar.HOUR_OF_DAY, 0);
//    toCalendar.set(Calendar.MINUTE, 0);
//    toCalendar.set(Calendar.SECOND, 0);
//    toCalendar.set(Calendar.MILLISECOND, 0);
//    Date fromDate = null;
//    try {
//      fromDate = DAY_FORMAT.parse(festival);
//      Calendar fromCalendar = Calendar.getInstance();
//      fromCalendar.setTime(fromDate);
//      fromCalendar.set(Calendar.HOUR_OF_DAY, 0);
//      fromCalendar.set(Calendar.MINUTE, 0);
//      fromCalendar.set(Calendar.SECOND, 0);
//      fromCalendar.set(Calendar.MILLISECOND, 0);
//      day = (int) ((toCalendar.getTimeInMillis() - fromCalendar
//          .getTimeInMillis()) / (1000 * 60 * 60 * 24));
//    } catch (ParseException e) {
//      // TODO Auto-generated catch block
//      e.printStackTrace();
//      day = -1;
//    }
//    return (day >= 0) && (day <= dayRange);
//  }
// }
